Component({
  properties: {

  },
  data: {
    isLogin:false
  },
  lifetimes:{
    attached(){
      //回调地址
      let pages= getCurrentPages();
      let returnUrl=pages[pages.length-1].route
      // 获取token
      let app =getApp()
      let isLogin=app.token
      this.setData({
        isLogin
      })
      // 未登陆
      if(!isLogin){
        wx.navigateTo({
          url: '/pages/login/index?redirector='+returnUrl,
        });
      }
    }
  },
  methods: {

  }
})
